// 封装获取数据的文件

import request from '@/utils/request'

// 获取组织架构的数据
export function getDepartmentList() {
  return request({
    url: '/company/department'
  })
}

// 删除组织结构中的某个部门
export function delDepartments(id) {
  return request({
    url: '/company/department/' + id,
    method: 'delete'
  })
}

// 添加子部门
export function addDepartments(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}

// 获取某个部门信息
export function getDepartment(id) {
  return request({
    url: '/company/department/' + id
  })
}

// 修改某个部门信息
export function updateDepartments(data) {
  return request({
    url: '/company/department/' + data.id,
    method: 'put',
    data
  })
}
